3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
13 if (!defined('_ECRIRE_INC_VERSION')) return;
15 // http://doc.spip.org/@exec_documenter_dist
16 function exec_documenter_dist()
18 $script = _request('script'); // generalisation a tester
19 $iframe = _request('iframe');
20 $album = _request('s');
21 $type = _request('type');
22 $id = intval(_request(id_table_objet($type)));
23 exec_documenter_args($id, $type, $script, $album, $iframe);
26 // http://doc.spip.org/@exec_documenter_args
27 function exec_documenter_args($id, $type, $script, $album='', $iframe=false)
29 if (!$id OR !autoriser('modifier', $type, $id) OR !preg_match('/^\w*$/', $script)) {
30 include_spip('inc/minipres');
33 $album = !$album ?
'documents' : 'portfolio';
34 include_spip('inc/actions');
35 $documenter = charger_fonction('documenter', 'inc');
36 if ($iframe==='iframe') {
37 $res = $documenter($id, $type, "portfolio", 'ajax', '', $script).
38 $documenter($id, $type, "documents", 'ajax', '', $script);
39 ajax_retour("<div class='upload_answer upload_document_added'>".$res."</div>",false);
40 } else ajax_retour($documenter($id, $type, $album, 'ajax', '', $script));